@model Web
@{
    var context = WebSiteContext.Current;
    Layout = "~/Views/Shared/_Dashboard.cshtml";
}
@UIHelper.ImageTitle(Html.Global("SiteSettings"), Html.Global("SiteSetings_Desc"), "~/content/images/icon_console.png")
<div id="sitesettingcontainer" style="font-weight: normal;">
    @using (Html.BeginForm())
    {
        Ajax.Dna().Tabs("sitecommonsettings")
            .Options(opts =>
            {
                opts.Animations = new { opacity = "toggle", height = "toggle", width = "toggle" };
            })
               .Views(views =>
               {
                   views.Add(Html.Global("RES_COMMON")).Template(@<text>
        <table cellspacing="0" class="d-field-table">
            <tr>
                <td>
                    <h3 class="d-field-title">
                        <label for="Web_Title">
                            @Html.Global("RES_TITLE")
                        </label>
                    </h3>
                    <div class="d-field-description">
                        @Html.Global("RES_WEBSITE_TITLE_TIPS")
                    </div>
                </td>
                <td>
                    @Ajax.DnaFor().TextBox(m => m.Title).Width(300).GetHtml()
                </td>
            </tr>
            <tr>
                <td>
                    <h3 class="d-field-title">
                        @Html.Global("RES_LANGUAGE")</h3>
                    <div class="d-field-description">
                        @Html.Global("RES_LANGUAGE_OPTION_TIPS")
                    </div>
                </td>
                <td>
                    @(
 Ajax.Dna().ComboBox("Web.DefaultLanguage")
                                   .DropDownStyle(DropdownStyles.DropdownList)
                                   .Width(250)
                                   .Select(Model.DefaultLanguage)
                                           .Bind(context.Languages)
                                   .GetHtml()
                   )
                </td>
            </tr>
            <tr>
                <td>
                    <h3 class="d-field-title">
                        @Html.Global("RES_TIMEZONE")</h3>
                    <div class="d-field-description">
                        @Html.Global("RES_TIMEZONE_TIPS")
                    </div>
                </td>
                <td>
                    @(Ajax.Dna().ComboBox("Web.TimeZone")
                           .DropDownStyle(DropdownStyles.DropdownList)
                           .Width(250)
                           .Select(Model.TimeZone)
                                   .Bind(context.TimeZones, z => z.Title, z => z.Value)
                           .GetHtml()
                    )
                </td>
            </tr>
            <tr>
                <td>
                    <h3 class="d-field-title">
                        <label for="Web_Description">
                            @Html.Global("RES_DESC")</label></h3>
                    <div class="d-field-description">
                        @Html.Global("RES_WEBSITE_DESC_TIPS")
                    </div>
                </td>
                <td>
                    @Ajax.DnaFor().TextArea(m => m.Description).Width(500).Height(120).Resizable().GetHtml()
                </td>
            </tr>
            <tr>
                <td>
                    <h3 class="d-field-title">
                        <label for="Web_SearchKeywords">
                            @Html.Global("RES_KEYWORD")</label></h3>
                    <div class="d-field-description">
                        @Html.Global("RES_KEYWORD_TIPS")
                    </div>
                </td>
                <td>
                    @Ajax.DnaFor().TextArea(m => m.SearchKeywords).Width(500).Height(120).Resizable().GetHtml()
                </td>
            </tr>
            @if (Model.IsRoot)
            { 
                <tr>
                    <td>
                        <h3 class="d-field-title">
                            <label for="Web_Copyright">
                                @Html.Global("RES_COPYRIGHT")</label>
                        </h3>
                        <div class="d-field-description">
                            @Html.Global("RES_COPYRIGHT_TIPS")
                        </div>
                    </td>
                    <td>
                        @Ajax.DnaFor().TextArea(m => m.Copyright).Width(500).Height(120).Resizable().Value(Model.Copyright).GetHtml()
                    </td>
                </tr>
            }
        </table>
        </text>);
                   if (Model.IsRoot)
                   {
                       views.Add(Html.Global("RES_ACCESSIBLITY_SETTINGS"))
                           .Template(@<text>
        <table cellspacing="0" class="d-field-table">
            <tr>
                <td valign="top">
                    <h3 class="d-field-title">
                        @Html.Global("RES_ENABLEREGISTATION")</h3>
                </td>
                <td>
                    @( Ajax.DnaFor().CheckBox(m => m.EnableUserRegistration, Html.Global("RES_ENABLEREGISTATION"),
                   Url.Content("~/content/images/icon_accept_16.png"),
                   Url.Content("~/content/images/icon_block_16.png")).GetHtml())
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <h3 class="d-field-title">
                        @Html.Global("SiteSettings_EnableSNS")</h3>
                </td>
                <td>
                    @( Ajax.Dna().Checkbox("EnableSNS", Html.Global("SiteSettings_EnableSNS"),
                    WebSiteContext.Current.EnablePersonalWeb,
                   Url.Content("~/content/images/icon_accept_16.png"),
                   Url.Content("~/content/images/icon_block_16.png")).GetHtml())
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <h3 class="d-field-title">
                        @Html.Global("SiteSettings_ENABLE_reCAPTCHA")</h3>
                    <div class="d-field-description">
                        @MvcHtmlString.Create(Html.Global("SiteSettings_reCAPTCHA_HELPTEXT"))</div>
                </td>
                <td valign="middle">
                    <div>
                        @Html.Global("RES_PUBLIC_KEY"):</div>
                    <div>@Ajax.Dna().TextBox("MasterTools.ReCaptchaPublicKey").Width(200).Value(Model.MasterTools.ReCaptchaPublicKey).GetHtml()</div>
                    <div>
                        @Html.Global("RES_PRIVATE_KEY"):</div>
                    <div>@Ajax.Dna().TextBox("MasterTools.ReCaptchaPrivateKey").Width(200).Value(Model.MasterTools.ReCaptchaPrivateKey).GetHtml()</div>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <h3 class="d-field-title">
                        @Html.Global("RES_DEFAULT_URL")</h3>
                    <div class="d-field-description">
                        @Html.Global("SiteSettings_SetDefaultUrl_Tips")</div>
                </td>
                <td>
                    @Ajax.DnaFor().TextBox(m => m.DefaultUrl).Width(300).GetHtml()
                </td>
            </tr>
            @*            <tr>
                <td>
                    <h3 class="d-field-title">
                        @Html.Global("SiteSettings_CacheDuration")</h3>
                    <div class="d-field-description">
                        @Html.Global("SiteSettings_CacheDuration_Tips")
                    </div>
                </td>
                <td>
                    <div style="text-align: center;">
                        <span id="cacheDurationLabel">
                            @Model.CacheDuration</span><span>(s)</span></div>
                    @(
 Ajax.Dna().Slider("Web.CacheDuration")
                            .Options(opts =>
                            {
                                opts.EnabledAnimate = true;
                                opts.Maximum = 3600;
                                opts.Minimum = 0;
                                opts.Step = 60;
                            })
                            .FillTextTo("cacheDurationLabel")
                            .Value(Model.CacheDuration)
                            .GetHtml()
                   )
                </td>
            </tr>*@
            <tr>
                <td valign="top">
                    <h3 class="d-field-title">
                        @Html.Global("RES_ALLOWEXTENSIONS")</h3>
                    <div class="d-field-description">
                        @Html.Global("SiteSettings_AllowExtensions_Tips")
                    </div>
                </td>
                <td valign="top">
                    @Ajax.DnaFor().TextArea(m => m.AllowExtensions).Width(300).GetHtml()
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <h3 class="d-field-title">
                        @Html.Global("RES_MAXFILESIZE")
                    </h3>
                </td>
                <td valign="top">
                    <table>
                        <tr>
                            <td>
                                @Ajax.Dna().TextBox("Web.MaximumFileSize").Width(75).NumericOnly().Value(Model.MaximumFileSize.ToString()).GetHtml()
                            </td>
                            <td>
                                (MB)
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        </text>);
                       views.Add(Html.Global("SiteSettings_WebMasterTools"))
                           .Template(@<text>
        <table cellspacing="0" class="d-field-table">
            <tr>
                <td valign="top">
                    <h3 class="d-field-title">
                        @MvcHtmlString.Create(Html.Global("SiteSettings_GSiteMap"))</h3>
                    <div class="d-field-description">
                        @MvcHtmlString.Create(Html.Global("SiteSettings_GSiteMap_Tips"))
                    </div>
                </td>
                <td valign="middle">
                    <span><a target="_blank"  href="@(context.ApplicationPath + "/sitemapindex")">@context.ApplicationPath/sitemapindex</a></span>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <h3 class="d-field-title">
                        <label for="MasterTools_GAAccount">
                            @Html.Global("RES_GAACCOUNT")</label></h3>
                    <div class="d-field-description">
                        @MvcHtmlString.Create(Html.Global("SiteSettings_GA_Tips"))
                    </div>
                </td>
                <td valign="middle">
                    @Ajax.Dna().TextBox("MasterTools.GAAccount").Width(200).Value(Model.MasterTools.GAAccount).GetHtml()
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <h3 class="d-field-title">
                        <label for="Web_AddThisCode">
                            @MvcHtmlString.Create(Html.Global("SiteSettings_WebMaster_VerTools"))
                        </label>
                    </h3>
                    <div class="d-field-description">
                        @Html.Global("SiteSettings_Verify_Tips")
                        <a href="https://www.google.com/webmasters/tools/" target="_blank">
                            @Html.Global("SiteSettings_GoogleWebmasterTools")</a>, <a href="https://siteexplorer.search.yahoo.com/"
                                target="_blank">
                                @Html.Global("SiteSettings_YahooSiteExplorer")</a>, <a href="http://www.bing.com/webmaster"
                                    target="_blank">
                                    @Html.Global("SiteSettings_BingWebmaster")</a></div>
                </td>
                <td>
                    <div style="margin-bottom: 10px;">
                        <div>
                            <label for="MasterTools_GoogleWebMasterTools">
                                @Html.Global("SiteSettings_GoogleWebmasterTools")</label></div>
                        <div>
                            @Ajax.Dna().TextBox("MasterTools.GoogleWebMasterTools").Width(300).Value(Model.MasterTools.GoogleWebMasterTools).GetHtml()
                        </div>
                        <div>
                            @Html.Global("SiteSettings_Example"): &lt;meta name='google-site-verification' content=<u>'dBw5CvburAxi537Rp9qi5uG2174Vb6JwHwIRwPSLIK8'</u>&gt</div>
                    </div>
                    <div style="margin-bottom: 10px;">
                        <div>
                            <label for="MasterTools_YahooSiteExplorer">
                                @Html.Global("SiteSettings_YahooSiteExplorer")</label></div>
                        <div>
                            @Ajax.Dna().TextBox("MasterTools.YahooSiteExplorer").Width(300).Value(Model.MasterTools.YahooSiteExplorer).GetHtml()
                        </div>
                        <div>
                            @Html.Global("SiteSettings_Example"): &lt;meta name='y_key' content=<u>'3236dee82aabe064'</u>&gt</div>
                    </div>
                    <div style="margin-bottom: 10px;">
                        <div>
                            <label for="MasterTools_BingWebMasterCenter">
                                @Html.Global("SiteSettings_BingWebmaster")</label></div>
                        <div>
                            @Ajax.Dna().TextBox("MasterTools.BingWebMasterCenter").Width(300).Value(Model.MasterTools.BingWebMasterCenter).GetHtml()
                        </div>
                        <div>
                            @Html.Global("SiteSettings_Example"): &lt;meta name='msvalidate.01' content=<u>'12C1203B5086AECE94EB3A3D9830B2E'</u>&gt</div>
                    </div>
                </td>
            </tr>
        </table>
        </text>);
                   }
                   views.Add(Html.Global("SiteSettings_ResProtection"))
                       .Template(@<text>
        <table cellspacing="0" class="d-field-table">
            <tr>
                <td>
                    <h3 class="d-field-title">
                        @Html.Global("SiteSettings_EnablePreventLink")</h3>
                    <div class="d-field-description">
                        @Html.Global("SiteSettings_PreventLink_Tips")
                    </div>
                </td>
                <td>
                    @(Ajax.Dna().Checkbox("MasterTools.PreventUntrustLinks", Html.Global("RES_ENABLED"),
                       Model.MasterTools.PreventUntrustLinks, Url.Content("~/content/images/icon_accept_16.png"),
                           Url.Content("~/content/images/icon_block_16.png"))
                       .GetHtml())
                </td>
            </tr>
            <tr>
                <td>
                    <h3 class="d-field-title">
                        <label for="MasterTools_TrustDomains">
                            @Html.Global("SiteSettings_TrustedDomains")</label>
                    </h3>
                    <div class="d-field-description">
                        @MvcHtmlString.Create(Html.Global("SiteSettings_TrustedDomains_Tips"))
                    </div>
                </td>
                <td>
                    @(
 Ajax.Dna().TextArea("MasterTools.TrustDomains")
                            .Width(300)
                            .Value(Model.MasterTools.TrustDomains)
                            .GetHtml()
                    )
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <h3 class="d-field-title">
                        <label for="MasterTools_UrlForUntrustLink">
                            @Html.Global("SiteSettings_UrlForUntrustedDomains")</label>
                    </h3>
                    <div class="d-field-description">
                        @Html.Global("SiteSettings_UrlForUntrustedDomains_Tips")
                    </div>
                </td>
                <td>
                    @Ajax.Dna().TextBox("MasterTools.UrlForUntrustLink").Width(300).Value(Model.MasterTools.UrlForUntrustLink).GetHtml()
                </td>
            </tr>
        </table>
        </text>);
                   if (Model.IsRoot)
                   {
                       views.Add(Html.Global("SiteSettings_Networks"))
                           .Template(@<text>
        <table cellspacing="0" class="d-field-table">
            <tr>
                <td valign="top">
                    <h3 class="d-field-title">
                        Facebook</h3>
                    <div class="d-field-description">
                        <a href="http://www.facebook.com/developers/createapp.php" target="_blank">Register</a>
                        a new Facebook application and make note of the <b>AppID</b> and <b>Secret</b>.
                        (Check <a target="_blank" href="http://www.facebook.com/developers">http://www.facebook.com/developers</a>
                        for instructions on how to create a Facebook application).
                    </div>
                </td>
                <td>
                    <div>
                        AppID</div>
                    <div>@Ajax.Dna().TextBox("FacebookAppID").Width(300).Value(System.Web.Configuration.WebConfigurationManager.AppSettings["facebookAppID"]).GetHtml()</div>
                    <div>
                        Secret</div>
                    <div>@Ajax.Dna().TextBox("FacebookSecret").Width(300).Value(System.Web.Configuration.WebConfigurationManager.AppSettings["facebookSecret"]).GetHtml()</div>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <h3 class="d-field-title">
                        Twitter</h3>
                    <div class="d-field-description">
                        <a href="http://www.facebook.com/developers/createapp.php" target="_blank">Register</a>
                        a new Twitter application and make note of the <b>Consumer Key</b> and <b>Consumer Secret</b>.
                        (Check <a target="_blank" href="https://dev.twitter.com/docs">https://dev.twitter.com/docs</a>
                        for instructions on how to create a Twitter application).
                    </div>
                </td>
                <td>
                    <div>
                        Consumer Key</div>
                    <div>@Ajax.Dna().TextBox("TwitterConsumerKey").Width(300).Value(System.Web.Configuration.WebConfigurationManager.AppSettings["twitterConsumerKey"]).GetHtml()</div>
                    <div>
                        Consumer Secret</div>
                    <div>@Ajax.Dna().TextBox("TwitterConsumerSecret").Width(300).Value(System.Web.Configuration.WebConfigurationManager.AppSettings["twitterConsumerSecret"]).GetHtml()</div>
                </td>
            </tr>
        </table>
        </text>);
                   }
               })
               .Render();
        <div style="text-align: center; margin-top: 10px;">
            @{
        Ajax.Dna().Button("btnSiteSettingSubmit")
            .ImageIcons(Url.Content("~/content/images/icon_save.gif"))
            .LocText("RES_SAVE")
            .Submit()
            .Render();

        Ajax.Dna().Button("btnCreateSolution")
            .LocText("RES_EXPORT")
            .Click("location=\"" + Url.Action("Export", "Solution", new { Area = "" }) + "\";")
            .ImageIcons(Url.Content("~/content/images/icon_download_16.gif"))
            .Render();
            }
        </div>
    }
</div>
@Html.StartupScripts()
